<?php
require_once '../ptnhuan-web1/libraries/utilites/functions.php';
$path = "../ptnhuan-web1/data/films.txt";
$full_path = realpath($path);
$films = mreadFile($path);
?>


<form method="POST">
  <?php 
  foreach ($films as $item ){
  $filter = trim($item,"\n\t\r");//trim loai bo khoang trang,xg dong,ve dau dong
  $film = explode(";", $filter);//tach chuoi thanh mang";"
  if($_GET["if"]==$film[0])
  {    
  
  ?>
<img src = '../ptnhuan-web1/public/images/films/<?php echo $film[1] ?>'><br>
<pre>Ten:   <input size="30" type="text" name="name" value=" <?php if (!empty($film[2])) echo $film[2] ?>"><br></pre>
<pre>Rating:<input size="30"  type="text" name="name" value=" <?php if (!empty($film[3])) echo $film[3] ?>"><br></pre>
<pre>Comment:
        <textarea name="comment" cols="20" rows="5"></textarea><br></pre>
<pre><input type="submit" name="submit" value="Save"></pre>
 <?php }}?>
</form>